
	$('a[name="seeProductDetail"]').click(function(){
		var productId = $(this).attr("id");
		var json = {
				"productId" : productId
		}
		var jsonStr = JSON.stringify(json);
		window.location.href = base_url + "customer/getProductDetail?jsonStr="+jsonStr;
	})
	
	window.onscroll = function(){
		lazyLoad($(".lazy[data-load='false']"));
	}
	
	var mySwiper = new Swiper('.swiper-container', {
		autoplay: 3000,//可选选项，自动滑动
		loop:true,
		autoplayDisableOnInteraction:false
	})
	
	var FormatImg = function(selected,container){
		selected.each(function(){
			var imgsrc =  $(this).attr("data-src");
			var wImage = $(this);
			var imgobj = new Image();
			imgobj.onload = function(){
			var h = this.height;
			var w = this.width;
			var winWidth = container.width();
			var winHeight = container.height();
			var rh = winWidth*h/w;
			var rw = winHeight*w/h;
			var paddingLeft = parseInt((winWidth-rw)/2);
			var paddingTop = parseInt((winHeight-rh)/2);
			if(h/w>winHeight/winWidth)	{
				wImage.attr("src",imgsrc).css("height",winHeight).css("padding-left",paddingLeft);
				console.log("1")
			}else{
				wImage.attr("src",imgsrc).css("width","100%").css("padding-top",paddingTop);
				console.log("2")
			}
		}
		imgobj.src = imgsrc;
			
		})
	}
	FormatImg($(".format"),$(".format").parents(".swiper-container"))